<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>凡客-首页</title>
<!--bootstrap-->
<link rel="stylesheet" type="text/css" href="<?php echo __PUBLIC__?>/Home/org/bootstrap-3.3.5-dist/css/bootstrap.min.css" />
<script src="<?php echo __PUBLIC__?>/Home/js/jquery.js" type="text/javascript" charset="utf-8"></script>
<script src="<?php echo __PUBLIC__?>/Home/org/bootstrap-3.3.5-dist/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>

<link rel="stylesheet" type="text/css" href="<?php echo __PUBLIC__?>/Home/css/index.css" />
</head>
<body>
<!--顶部灰色区域-->
<div id="top">
    <div class="header">
        <div class="header_left">
            <div class="welcome">
            您好,
            <?php if(isset($_SESSION['hname'])){?>
                
            <span><a href="" style="color:#A10000;"><?php echo $_SESSION['hname']?></a> <a href="<?php echo U('Login/out')?>" style="color:#A10000;"> 退出登陆 </a> | <a href="<?php echo U('Login/tab')?>" style="color:#A10000;">切换用户</a></span>
            <?php }else{?>
            欢迎光临凡客诚品！
            <span><a href="<?php echo U('Login/login')?>">登录</a> | <a href="<?php echo U('Register/register')?>">注册</a></span>
            
               <?php }?>
            </div>
            <div class="collect">
                <?php if(isset($_SESSION['hname'])){?>
                
                <a href="<?php echo U('Member/dingdan')?>">我的订单</a>
                <?php }else{?>
                <a href="<?php echo U('Login/login')?>">我的订单</a>
                
               <?php }?>
                <a href="">收藏本站</a>
            </div>
        </div>
        <div class="header_right">
            <ul>
                <li>
                    <a href="<?php echo U('Member/index')?>">我的凡客<span></span></a>
                    <div class="listBox">
                        <a href="<?php echo U('Member/index')?>">我的凡客<span></span></a>
                        <ul style="clear: both;">
                            <li><a href="<?php echo U('Member/dingdan')?>">我的订单</a></li>
                            <li><a href="">我的收藏</a></li>
                        </ul>
                    </div>
                </li>
                <li>
                    <a href="">帮助中心<span></span></a>
                    <div class="listBox">
                        <a href="">帮助中心<span></span></a>
                        <ul>
                            <li><a href="">购物指南</a></li>
                            <li><a href="">配送方式</a></li>
                            <li><a href="">支付方式</a></li>
                            <li><a href="">售后服务</a></li>
                            <li><a href="">投诉建议</a></li>
                            <li><a href="">在线客服</a></li>
                        </ul>
                    </div>
                </li>
                <li>
                    <a href="">网站公告<span></span></a>
                    <div class="listBox">
                        <a href="">网站公告<span></span></a>
                        <ul>
                            <li><a href="">春节公告</a></li>
                            <li><a href="">网站公告</a></li>
                            <li><a href="">重要提示</a></li>
                        </ul>
                    </div>
                </li>
                <li><a href="">手机凡客<span class="tel"></span></a></li>
                <li><a href="">在线客服<span class="line"></span></a></li>
            </ul>
            <a href="" class="weibo"></a>
            <a href="" class="weixin"></a>
        </div>
    </div>
</div>
<!--顶部灰色区域结束-->
<!--广告区域-->
<div id="ad">
    <a class="adred" href="">       
        <img src="<?php echo __PUBLIC__?>/Home/images/index.png"/>
    </a>
</div>
<!--广告区域结束-->
<!--搜索区域-->
    <!-- 发送异步  判断购物车是否有商品 -->
    <script type="text/javascript">
        $(function(){
            $(document).on("mouseenter", ".carttop", function(){ 
                // alert(1);
                $.ajax({
                    url: '<?php echo U('ajaxCart')?>',
                    type: 'POST',
                    dataType: 'json',
                    data: {param1: 'value1'},
                    success:function(arr){
                        console.log(arr);
                        if(arr.goods.length!=0){
                            tr = '<a href="index.php?m=Home&c=car&a=index" class="carttop">购物车（'+arr.total_rows+'）</a><div class="index_2"></div><div class="index_1">最近加入的商品：<br /><ul>';
                            $.each(arr.goods, function(k, v) {
                                tr += '<li><input type="hidden" name="gid" value="'+k+'" /><div><img src="'+v.pic+'" alt="" /></div><div><a href="index.php?m=Home&c=Desc&a=index&gid='+v.id+'" class="gname">'+v.name+'&nbsp;';
                                    $.each(v.options, function(kk, vv) {
                                        tr += vv;
                                    });
                                tr += '</a><p class="price"> ￥'+v.price+'×'+v.num+'</p></div><div class="gdel"><a href="javascript:;" class="cardel">删除</a></div></li>';
                            });
                            tr += '</ul><div class="total"><p>共计(未计算促销折扣)<br />￥'+arr.total+'</p><a href="index.php?m=Home&c=car&a=index" class="showcart">查看购物车（'+arr.total_rows+'）</a></div></div>';
                            $('.shoppingcart').html(tr);
                        }else{
                            tr = '<a href="index.php?m=Home&c=car&a=index" class="carttop">购物车（0）</a><div class="index_2"></div><div class="index_1">您的购物车中没有任何商品</div>';
                            $('.shoppingcart').html(tr);
                        }
                    }
                })
            });
        })
        // 异步删除购物车中的商品
        // 高版本下不支持live事件  用on代替
        $(function(){
            $(document).on("click", ".cardel", function(){ 
                var _this=$(this);
                // alert(1);
                // 获得商品序号
                var gid = $(this).parents('li').find('input[name=gid]').val();
                // alert(gid);
                $.ajax({
                    url: '<?php echo U('ajaxDel')?>',
                    type: 'POST',
                    dataType: 'json',
                    data: {gid: gid},
                    success:function(arr){
                        if(arr.total!=0){
                            tr = '购物车（'+arr.total+'）';
                            $('.shoppingcart .carttop').text(tr);
                            $('.shoppingcart .total').html('<p>共计(未计算促销折扣)<br />￥'+arr.total+'</p><a href="index.php?m=Home&c=car&a=index" class="showcart">查看购物车（'+arr.total_rows+'）</a>')
                            _this.parents('li').remove();
                        }else{
                            tr = '<a href="index.php?m=Home&c=car&a=index" class="carttop">购物车（0）</a><div class="index_2"></div><div class="index_1">您的购物车中没有任何商品</div>';
                            $('.shoppingcart').html(tr);
                        }
                    }
                })
            });
        })
    </script>
<div id="seek">
    <div class="logo">
        <a href="javascript:;"></a>
    </div>
    <div class="search_">
        <div class="searchTab">
            <form action="" method="post">
                <input type="text" class="searchTab_1" placeholder="搜“羽绒服”，体验与众不同"/>
                <input type="submit" value=""  class="searchTab_2"/>
            </form>
            <div class="shoppingcart">
                <?php if(isset($_SESSION['cart']['goods']) && !empty($_SESSION['cart']['goods'])){?>
                
                    <a href="<?php echo U('Car/index')?>" class="carttop">购物车（<?php echo $_SESSION['cart']['total_rows']?>）</a>
                    <div class="index_2"></div>
                    <div class="index_1">最近加入的商品：<br />
                        <ul>
                            <?php foreach ($_SESSION['cart']['goods'] as $k=>$v){?>
                            <li>
                                <input type="hidden" name="gid" value="<?php echo $k?>" />
                                <div><img src="<?php echo $v['pic']?>" alt="" /></div>
                                <div>
                                    <a href="<?php echo U('Desc/index',array('gid'=>$v['id']))?>" class="gname"><?php echo $v['name']?></a>
                                    <p class="price"> ￥<?php echo $v['price']?>×<?php echo $v['num']?></p>
                                </div>
                                <div class="gdel">
                                    <a href="javascript:;" class="cardel">删除</a>
                                </div>
                            </li>
                            <?php }?>
                        </ul>
                        <div class="total">
                            <p>共计(未计算促销折扣)<br />￥<?php echo $_SESSION['cart']['total']?></p>
                            <a href="<?php echo U('Car/index')?>" class="showcart">查看购物车（<?php echo $_SESSION['cart']['total_rows']?>）</a>
                        </div>
                    </div>
                <?php }else{?>
                    <a href="<?php echo U('Car/index')?>" class="carttop">购物车（0）</a>
                    <div class="index_2"></div>
                    <div class="index_1">您的购物车中没有任何商品</div>
                
               <?php }?>
            </div>
        </div>
        <div class="searchText">
            热门搜索：<a href="">羽绒服</a><a href="">外套</a><a href="">衬衫</a><a href="">针织衫</a><a href="">帆布鞋</a>
        </div>
    </div>
</div>
<!--搜索区域结束-->
<!--导航条-->
<div id="menu">
    <div class="all">全部商品分类</div>
    <ul>
        <?php foreach ($menu as $k=>$v){?>
        <li>
            <a href="<?php echo U('List/index',array('cid'=>$v['cid']))?>" target="_blank" class="fir_menu"><?php echo $v['cname']?></a>
            <div class="sec_menu">
                <?php foreach ($v['goods'] as $kk=>$vv){?>
                <div class="sec_menu_clo">
                    <img src="<?php echo $vv['pic']?>"/>
                    <h3><a href="<?php echo U('Desc/index',array('gid'=>$vv['gid']))?>" target="_blank"><?php echo $vv['gname']?></a></h3>
                    <span>￥<?php echo $vv['sprice']?></span>
                </div>
                <div class="sec_menu_line"></div>
               <?php }?>
            </div>
        </li>
        <?php }?>
        <li><a href="" class="fir_menu">特惠频道</a></li>
    </ul>
</div>
<!--导航条结束-->
<!--焦点区域-->
<div id="focus">
    <div class="focus_left">

        <!-- 控制单独样式 -->
        <script type="text/javascript">
            $(function(){
                $('#focus .focus_left .focus_left_demo ul li:nth-child(1)').find('a').removeClass('index')
            })
        </script>

        <!-- 男装 女装 -->
        <?php foreach ($cateData as $k=>$v){?>
        <div class="focus_left_demo">
            <h3><a href="<?php echo U('List/index',array('cid'=>$v['cid']))?>" target="_blank"><?php echo $v['cname']?></a></h3>

            <?php foreach ($v['two'] as $kk=>$vv){?>
                <h4><a href="<?php echo U('List/index',array('cid'=>$vv['cid']))?>" target="_blank"><?php echo $vv['cname']?></a></h4>
                    <ul>
                        <?php foreach ($vv['three'] as $kkk=>$vvv){?>
                        <li><a href="<?php echo U('List/index',array('cid'=>$vvv['cid']))?>" target="_blank" class="index"><?php echo $vvv['cname']?></a></li>
                        <?php }?>
                    </ul>
            <?php }?>

        </div>
        <?php }?>
       
       
       <!-- 鞋袜 -->
        <div class="focus_left_demo">
        <h3>
            <?php foreach ($shoeData as $k=>$v){?>
            <a href="<?php echo U('List/index',array('cid'=>$v['cid']))?>" target="_blank"><?php echo $v['cname']?>/</a>
            <?php }?>
        </h3>
            <ul>
                <?php foreach ($shoeData as $k=>$v){?>
                <li><a href="<?php echo U('List/index',array('cid'=>$v['cid']))?>" target="_blank" class="index"><?php echo $v['cname']?></a></li>
                <?php }?>
            </ul>
        </div>
    </div>
    <!--轮播-->
    <div class="focus_middle">
        <script type="text/javascript">
            $(function() {
                //              大总管变量
                var c = 0;

                function run() {
                    c++;
                    c = (c == 6) ? 0 : c;
                    //                  让c号图片显示，其他图片隐藏
                    $('#fk a').eq(c).stop().fadeIn(600).siblings('a').stop().fadeOut(600);
                    //                  让c号li变红，其他的变黑
                    $('#fk ul li').eq(c).css({
                        'background': '#A10000'
                    }).siblings('li').css({
                        'background': '#1e1e1e'
                    });
                }
                //              设置定时器，每隔一秒钟变换一张图片
                timer = setInterval(run, 4000)
                    //              给li加鼠标移入事件
                $('#fk ul li').mouseover(function() {
                        //                  停止定时器
                        clearInterval(timer);
                        //                  将当前移入的li的序号存到c里
                        c = $(this).index();
                        //让c号图片显示，其他图片隐藏
                        $('#fk a').eq(c).stop().fadeIn().siblings('a').stop().fadeOut();
                        //                  让c号li变红，其他的变黑
                        $('#fk ul li').eq(c).css({
                            'background': '#A10000'
                        }).siblings('li').css({
                            'background': '#1e1e1e'
                        });
                    })
                    //              给li加鼠标移出事件
                $('#fk ul li').mouseout(function() {
//                  恢复定时器
                    timer = setInterval(run, 4000);
                })
            })
        </script>
        <div id="fk">
            <!--img[src=images/$.jpg]*6-->
            <a href="<?php echo U('Desc/index',array('gid'=>1))?>" style="display: block;" target="_blank"><img src="<?php echo __PUBLIC__?>/Home/images/0.jpg" /></a>
            <a href="<?php echo U('Desc/index',array('gid'=>46))?>" target="_blank"><img src="<?php echo __PUBLIC__?>/Home/images/1.jpg" alt="" /></a>
            <a href="<?php echo U('Desc/index',array('gid'=>45))?>" target="_blank"><img src="<?php echo __PUBLIC__?>/Home/images/2.jpg" alt="" /></a>
            <a href="<?php echo U('Desc/index',array('gid'=>47))?>" target="_blank"><img src="<?php echo __PUBLIC__?>/Home/images/3.jpg" alt="" /></a>
            <a href="<?php echo U('Desc/index',array('gid'=>9))?>" target="_blank"><img src="<?php echo __PUBLIC__?>/Home/images/4.jpg" alt="" /></a>
            <a href="<?php echo U('Desc/index',array('gid'=>48))?>" target="_blank"><img src="<?php echo __PUBLIC__?>/Home/images/5.jpg" alt="" /></a>
            <ul>
                <li style="background: #A10000;"></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
            </ul>
        </div>
    </div>
    
    <div class="focus_right">
        <a href="<?php echo U('Desc/index',array('gid'=>31))?>" target="_blank"><img src="<?php echo __PUBLIC__?>/Home/images/zkmwy.jpg" alt="" style="border-bottom: none;"/></a>
        <a href="<?php echo U('Desc/index',array('gid'=>24))?>" target="_blank"><img src="<?php echo __PUBLIC__?>/Home/images/100xxk.jpg" alt="" /></a>
    </div>
</div>
<!--焦点区域-->
<!--当季推荐-->
<div id="recommend">
    <h2>当季推荐</h2>
    <div class="recommend_content">
        <ul>
            <?php foreach ($dangji as $k=>$v){?>
            <li><a href="<?php echo U('Desc/index',array('gid'=>$v['gid']))?>" target="_bank"><img src="<?php echo $v['pic']?>" alt="" title="<?php echo $v['gname']?>" /></a></li>
            <?php }?>
        </ul>
    </div>
</div>
<!--当季推荐结束-->
<!--上装-->
<div id="tops_clo">
    <h2>上装</h2>
    <div class="clothes">
        <ul>
            <li><a href="<?php echo U('List/index',array('cid'=>9))?>" target="_blank"><img src="<?php echo __PUBLIC__?>/Home/images/mtcs199.jpg" alt="" /></a></li>
            <li><a href="<?php echo U('List/index',array('cid'=>24))?>" target="_blank"><img src="<?php echo __PUBLIC__?>/Home/images/cqerj.jpg" alt="" /></a></li>
            <?php foreach ($shang as $k=>$v){?>
            <li><a href="<?php echo U('Desc/index',array('gid'=>$v['gid']))?>" target="_blank"><img src="<?php echo $v['pic']?>" alt="" class="shang" title="<?php echo $v['gname']?>" /></a></li>
            <?php }?>
        </ul>
    </div>
</div>
<!--上装结束-->
<!--下装-->
<div id="bottoms_clo">
    <h2>下装</h2>
    <div class="clothes">
        <ul>
            <li><a href="<?php echo U('List/index',array('cid'=>28))?>" target="_blank"><img src="<?php echo __PUBLIC__?>/Home/images/qtxl.jpg" alt="" /></a></li>
            <li><a href="<?php echo U('List/index',array('cid'=>21))?>" target="_blank"><img src="<?php echo __PUBLIC__?>/Home/images/tlmt.jpg" alt="" /></a></li>
            <?php foreach ($xia as $k=>$v){?>
            <li><a href="<?php echo U('Desc/index',array('gid'=>$v['gid']))?>" target="_blank"><img src="<?php echo $v['pic']?>" alt="" class="xia" title="<?php echo $v['gname']?>" /></a></li>
            <?php }?>
        </ul>
    </div>
</div>
<!--下装结束-->
<!--更多精品-->
<div id="hotsales">
    <h2>更多精品</h2>
    <div class="clothes">
        <ul>
            <?php foreach ($geng as $k=>$v){?>
            <li><a href="<?php echo U('Desc/index',array('gid'=>$v['gid']))?>" target="_blank"><img src="<?php echo $v['pic']?>" alt="" class="geng" title="<?php echo $v['gname']?>" /></a></li>
            <?php }?>
        </ul>
    </div>
</div>
<!--更多精品结束-->
<!--网页底部-->
<div id="footer">
    <ul>
        <li>
            <h2>关于凡客</h2>
            <p><a href="">公司简介</a></p>
            <p><a href="">联系我们</a></p>
            <p><a href="">友情链接</a></p>
        </li>
        <li>
            <h2>新手指南</h2>
            <p><a href="">账户注册</a></p>
            <p><a href="">购物流程</a></p>
            <p><a href="">网站地图</a></p>
        </li>
        <li>
            <h2>配送时间及时间</h2>
            <p><a href="">国内配送</a></p>
            <p><a href="">订单拆分</a></p>
        </li>
        <li>
            <h2>支付方式</h2>
            <p><a href="">货到付款</a></p>
            <p><a href="">在线支付</a></p>
            <p><a href="">礼品卡及账户余额</a></p>
            <p><a href="">其他支付方式</a></p>
        </li>
        <li>
            <h2>售后服务</h2>
            <p><a href="">退换货政策</a></p>
            <p><a href="">退换货办理流程</a></p>
            <p><a href="">退换货网上办理</a></p>
            <p><a href="">退款说明</a></p>
        </li>
        <li style="border: none;">
            <h2>帮助中心</h2>
            <p><a href="">在线客服</a></p>
            <p><a href="">找回密码</a></p>
            <p><a href="">隐私声明</a></p>
        </li>
    </ul>
</div>
<div id="footer_bg">
    <ul>
        <li><a href="javascript:;" class="index_1"></a></li>
        <li><a href="javascript:;" class="index_2"></a></li>
        <li><a href="javascript:;" class="index_3"></a></li>
        <li><a href="javascript:;" class="index_4"></a></li>
    </ul>
</div>
<!--网页底部结束-->
<!--网页结束-->
<div id="bottom">
    <p>Copyright 2007 - 2016 vancl.com All Rights Reserved   出版物经营许可证新出发京批字第直xxxxx号</p>
    <div>
        <a href="javascript:;" class="index_1"></a>
        <a href="javascript:;" class="index_2"></a>
        <a href="javascript:;" class="index_3"></a>
        <a href="javascript:;" class="index_4"></a>
        <a href="javascript:;" class="index_5"></a>
        <a href="javascript:;" class="index_6"><img src="<?php echo __PUBLIC__?>/Home/images/kexin_brand_for_others.png" alt="" /></a>
    </div>
</div>

        <!-- 返回顶部js -->
        <script type="text/javascript">
            $(function() {
                $(window).scroll(function(){
                    var scrolltop=$(this).scrollTop();      
                    if(scrolltop>=200){     
                        $(".toolbar").show();
                    }else{
                        $(".toolbar").hide();
                    }
                });     
                $(".toolbar-item-top").click(function(){
                    $("html,body").animate({scrollTop: 0}, 600);    
                });     
                
            })
        </script>
        <!--返回顶部-->
        <div class="toolbar" style="display:none;">
           <a href="###" class="toolbar-item toolbar-item-weixin">
           <span class="toolbar-layer"></span>
           </a>
           <a href="###" class="toolbar-item toolbar-item-feedback"></a>
           <a href="###" class="toolbar-item toolbar-item-app">
            <span class="toolbar-layer"></span>
           </a>
           <a href="javascript:;" class="toolbar-item toolbar-item-top"></a>
        </div>
</body>
</html>
